<div class="kt-modal-content">
    <div class="modal-header">
        <button type="button" class="close" ng-click="$dismiss()" aria-label="Close">
            <em class="ion-ios-close-empty sn-link-close"></em>
        </button>
        <h4 class="modal-title">{{kt.title}}</h4>
    </div>
    <div class="modal-body">
        <div ba-panel ba-panel-class="with-scroll light-text">
            <form name="Form">

                <div class="form-group col-md-6 col-sm-6 col-xs-6">
                    <label for="devUid">所属设备</label>
                    <select ng-disabled="kt.isView" class="form-control" ng-model="kt.devopt.deviceUid" id="devUid"
                            title="所属设备" data-container="body" selectpicker required
                            ng-options="item.value as item.label for item in kt.optDevList">
                    </select>
                </div>

                <div class="form-group col-md-6 col-sm-6 col-xs-6" style="margin-top: 28px;">
                    <h4>设备状态： {{kt.getDictLabel('DEV_ONLINE_STATUS', kt.devopt.isOnline)}} </h4>
                </div>

                <div class="form-group col-md-6 col-sm-6 col-xs-6">
                    <label>操作类型</label>
                    <select class="form-control" ng-model="kt.devopt.msgType"
                            title="操作类型" data-container="body" selectpicker required
                            ng-options="item.value as item.label for item in kt.devMsgType">
                    </select>
                </div>
                <div class="form-group col-md-6 col-sm-6 col-xs-6">
                    <label>命令标识符</label>
                    <select class="form-control" ng-model="kt.devopt.optType"
                            title="操作类型" data-container="body" selectpicker required
                            ng-options="item.value as item.label for item in kt.devOptType">
                    </select>
                </div>

                <div class="form-group col-md-8 col-sm-8 col-xs-8">
                    <label>操作指令</label>
                    <input ng-disabled="!kt.devopt.deviceUid || !kt.devopt.msgType || !kt.devopt.optType" type="text" class="form-control" required
                           ng-model="kt.devopt.optMsg">
                </div>
                <div class="form-group col-md-4 col-sm-4 col-xs-4" style="margin-top: 28px;" ng-if="kt.devopt.optType">
                    <h4>需输入 {{kt.devopt.optBodyLen}} 个字符</h4>
                </div>

                <div class="form-group col-md-8 col-sm-8 col-xs-8">
                    <label>命令预览</label>
                    <textarea ng-disabled="true" rows="1" class="form-control" required
                              ng-model="kt.devopt.msg"></textarea>
                </div>
                <div class="form-group col-md-4 col-sm-4 col-xs-4" ng-if="kt.devopt.msg" style="margin-top: 28px;">
                    <h4>指令长度 {{kt.devopt.msgLen}} 个字节</h4>
                    <h4>指令长度 {{kt.devopt.msgCLen}} 个字符</h4>
                </div>

                <div class="col-sm-12 hr-line-dashed"></div>

                <div class="form-group col-md-6 col-sm-6 col-xs-6">
                    <button type="submit" class="btn btn-primary btn-with-icon" ng-click="kt.sendMsg()" ng-disabled="!kt.devopt.isOnline || !kt.devopt.msg">
                        <i class="ion-heart"></i>发送指令
                    </button>
                </div>
                <div class="form-group col-md-6 col-sm-6 col-xs-6" style="margin-top: 5px;">
                    <h4>指令状态： {{kt.getDictLabel('DEV_OPT_STATUS', kt.devopt.optStatus)}}</h4>
                </div>

                <div class="col-sm-12 hr-line-dashed"></div>

                <div class="form-group col-md-8 col-sm-8 col-xs-8">
                    <label>命令接收</label>
                    <textarea ng-disabled="true" rows="2" class="form-control" required
                              ng-model="kt.devopt.retMsg"></textarea>
                </div>
                <div class="form-group col-md-4 col-sm-4 col-xs-4" ng-if="kt.devopt.retMsg" style="margin-top: 28px;">
                    <h4>命令接收 {{kt.devopt.retMsgLen}} byte</h4>
                    <h4>接收花费 {{kt.devopt.retTime}} 秒</h4>
                </div>
            </form>
        </div>
    </div>
</div>